#include "trade.h"
#include <string.h>
int nReq;

Trade::Trade(void)
{	
	_FrontConnected = NULL;
	_FrontDisconnected = NULL;
	_RspAuthenticate = NULL;
	_RspSubmitUserSystemInfo = NULL;
	_RspUserLogin = NULL;
	_RspUserPasswordUpdate = NULL;
	_RspErrorOrderInsert = NULL;
	_RspOrderAction = NULL;
	_RspErrorExerciseOrderInsert = NULL;
	_RspExerciseOrderAction = NULL;
	_RspErrorLockInsert = NULL;
	_RspForQuoteInsert = NULL;
	_RspErrorCombActionInsert = NULL;
	_RspQueryMaxOrderVolume = NULL;
	_RspQryLockVolume = NULL;
	_RspQueryExerciseVolume = NULL;
	_RspQryCombVolume = NULL;
	_RspQryPosition = NULL;
	_RspQryTradingAccount = NULL;
	_RspQryOrder = NULL;
	_RspQryTrade = NULL;
	_RspQryExercise = NULL;
	_RspQryLock = NULL;
	_RspQryCombAction = NULL;
	_RspQryPositionCombineDetail = NULL;
	_RspQryInstrument = NULL;
	_RspQryCoveredShort = NULL;
	_RspQryExerciseAssign = NULL;
	_RspTransfer = NULL;
	_RspQryTransfer = NULL;
	_RspQueryBankBalance = NULL;
	_RspQueryBankAccount = NULL;
	_RspMultiCentreFundTrans = NULL;
	_RspQueryBillContent = NULL;
	_RspBillConfirm = NULL;
	_RspQryMargin = NULL;
	_RspQryCommission = NULL;
	_RspQryPositionDetail = NULL;
	_RspQryExchangeRate = NULL;
	_RspQrySysConfig = NULL;
	_RspQryDepthMarketData = NULL;
	_RspFundTrans = NULL;
	_RspQryFundTrans = NULL;
	_RspQryClientNotice = NULL;
	_RspQryOptUnderly = NULL;
	_RspQrySecuDepthMarket = NULL;
	_RspQryHistOrder = NULL;
	_RspQryHistTrade = NULL;
	_RtnTrade = NULL;
	_RtnOrder = NULL;
	_RtnExercise = NULL;
	_RtnCombAction = NULL;
	_RtnLock = NULL;
	_ErrRtnOrderAction = NULL;
	_RtnClientNotice = NULL;
	
}


// 回调虚类
DLL_EXPORT_C_DECL void WINAPI tSetOnFrontConnected(Trade* spi, void* func){spi->_FrontConnected = func;}

// 当客户端与交易后台通信连接异常时，该方法被调用。
DLL_EXPORT_C_DECL void WINAPI tSetOnFrontDisconnected(Trade* spi, void* func){spi->_FrontDisconnected = func;}

// 客户认证
DLL_EXPORT_C_DECL void WINAPI tSetOnRspAuthenticate(Trade* spi, void* func){spi->_RspAuthenticate = func;}

// 终端信息上报接口(中继模式)
DLL_EXPORT_C_DECL void WINAPI tSetOnRspSubmitUserSystemInfo(Trade* spi, void* func){spi->_RspSubmitUserSystemInfo = func;}

// 客户登录
DLL_EXPORT_C_DECL void WINAPI tSetOnRspUserLogin(Trade* spi, void* func){spi->_RspUserLogin = func;}

// 密码更改
DLL_EXPORT_C_DECL void WINAPI tSetOnRspUserPasswordUpdate(Trade* spi, void* func){spi->_RspUserPasswordUpdate = func;}

// 报单录入
DLL_EXPORT_C_DECL void WINAPI tSetOnRspErrorOrderInsert(Trade* spi, void* func){spi->_RspErrorOrderInsert = func;}

// 撤单
DLL_EXPORT_C_DECL void WINAPI tSetOnRspOrderAction(Trade* spi, void* func){spi->_RspOrderAction = func;}

// 行权录入
DLL_EXPORT_C_DECL void WINAPI tSetOnRspErrorExerciseOrderInsert(Trade* spi, void* func){spi->_RspErrorExerciseOrderInsert = func;}

// 行权撤单
DLL_EXPORT_C_DECL void WINAPI tSetOnRspExerciseOrderAction(Trade* spi, void* func){spi->_RspExerciseOrderAction = func;}

// 锁定录入
DLL_EXPORT_C_DECL void WINAPI tSetOnRspErrorLockInsert(Trade* spi, void* func){spi->_RspErrorLockInsert = func;}

// 询价录入
DLL_EXPORT_C_DECL void WINAPI tSetOnRspForQuoteInsert(Trade* spi, void* func){spi->_RspForQuoteInsert = func;}

// 申请组合录入
DLL_EXPORT_C_DECL void WINAPI tSetOnRspErrorCombActionInsert(Trade* spi, void* func){spi->_RspErrorCombActionInsert = func;}

// 最大报单数量获取
DLL_EXPORT_C_DECL void WINAPI tSetOnRspQueryMaxOrderVolume(Trade* spi, void* func){spi->_RspQueryMaxOrderVolume = func;}

// 可锁定数量获取
DLL_EXPORT_C_DECL void WINAPI tSetOnRspQryLockVolume(Trade* spi, void* func){spi->_RspQryLockVolume = func;}

// 可行权数量获取
DLL_EXPORT_C_DECL void WINAPI tSetOnRspQueryExerciseVolume(Trade* spi, void* func){spi->_RspQueryExerciseVolume = func;}

// 申请组合最大数量获取
DLL_EXPORT_C_DECL void WINAPI tSetOnRspQryCombVolume(Trade* spi, void* func){spi->_RspQryCombVolume = func;}

// 持仓查询
DLL_EXPORT_C_DECL void WINAPI tSetOnRspQryPosition(Trade* spi, void* func){spi->_RspQryPosition = func;}

// 资金账户查询
DLL_EXPORT_C_DECL void WINAPI tSetOnRspQryTradingAccount(Trade* spi, void* func){spi->_RspQryTradingAccount = func;}

// 报单查询
DLL_EXPORT_C_DECL void WINAPI tSetOnRspQryOrder(Trade* spi, void* func){spi->_RspQryOrder = func;}

// 成交查询
DLL_EXPORT_C_DECL void WINAPI tSetOnRspQryTrade(Trade* spi, void* func){spi->_RspQryTrade = func;}

// 行权查询
DLL_EXPORT_C_DECL void WINAPI tSetOnRspQryExercise(Trade* spi, void* func){spi->_RspQryExercise = func;}

// 锁定查询
DLL_EXPORT_C_DECL void WINAPI tSetOnRspQryLock(Trade* spi, void* func){spi->_RspQryLock = func;}

// 申请组合查询
DLL_EXPORT_C_DECL void WINAPI tSetOnRspQryCombAction(Trade* spi, void* func){spi->_RspQryCombAction = func;}

// 组合持仓明细查询
DLL_EXPORT_C_DECL void WINAPI tSetOnRspQryPositionCombineDetail(Trade* spi, void* func){spi->_RspQryPositionCombineDetail = func;}

// 合约信息查询
DLL_EXPORT_C_DECL void WINAPI tSetOnRspQryInstrument(Trade* spi, void* func){spi->_RspQryInstrument = func;}

// 备兑缺口查询
DLL_EXPORT_C_DECL void WINAPI tSetOnRspQryCoveredShort(Trade* spi, void* func){spi->_RspQryCoveredShort = func;}

// 行权指派查询
DLL_EXPORT_C_DECL void WINAPI tSetOnRspQryExerciseAssign(Trade* spi, void* func){spi->_RspQryExerciseAssign = func;}

// 银行转账
DLL_EXPORT_C_DECL void WINAPI tSetOnRspTransfer(Trade* spi, void* func){spi->_RspTransfer = func;}

// 银行转账查询
DLL_EXPORT_C_DECL void WINAPI tSetOnRspQryTransfer(Trade* spi, void* func){spi->_RspQryTransfer = func;}

// 银行余额查询
DLL_EXPORT_C_DECL void WINAPI tSetOnRspQueryBankBalance(Trade* spi, void* func){spi->_RspQueryBankBalance = func;}

// 银行账户查询
DLL_EXPORT_C_DECL void WINAPI tSetOnRspQueryBankAccount(Trade* spi, void* func){spi->_RspQueryBankAccount = func;}

// 多中心资金调拨
DLL_EXPORT_C_DECL void WINAPI tSetOnRspMultiCentreFundTrans(Trade* spi, void* func){spi->_RspMultiCentreFundTrans = func;}

// 客户账单查询
DLL_EXPORT_C_DECL void WINAPI tSetOnRspQueryBillContent(Trade* spi, void* func){spi->_RspQueryBillContent = func;}

// 客户账单确认
DLL_EXPORT_C_DECL void WINAPI tSetOnRspBillConfirm(Trade* spi, void* func){spi->_RspBillConfirm = func;}

// 保证金查询
DLL_EXPORT_C_DECL void WINAPI tSetOnRspQryMargin(Trade* spi, void* func){spi->_RspQryMargin = func;}

// 手续费查询
DLL_EXPORT_C_DECL void WINAPI tSetOnRspQryCommission(Trade* spi, void* func){spi->_RspQryCommission = func;}

// 持仓明细查询
DLL_EXPORT_C_DECL void WINAPI tSetOnRspQryPositionDetail(Trade* spi, void* func){spi->_RspQryPositionDetail = func;}

// 汇率查询
DLL_EXPORT_C_DECL void WINAPI tSetOnRspQryExchangeRate(Trade* spi, void* func){spi->_RspQryExchangeRate = func;}

// 经纪公司配置参数查询
DLL_EXPORT_C_DECL void WINAPI tSetOnRspQrySysConfig(Trade* spi, void* func){spi->_RspQrySysConfig = func;}

// 行情查询
DLL_EXPORT_C_DECL void WINAPI tSetOnRspQryDepthMarketData(Trade* spi, void* func){spi->_RspQryDepthMarketData = func;}

// 资金调拨
DLL_EXPORT_C_DECL void WINAPI tSetOnRspFundTrans(Trade* spi, void* func){spi->_RspFundTrans = func;}

// 资金调拨流水查询
DLL_EXPORT_C_DECL void WINAPI tSetOnRspQryFundTrans(Trade* spi, void* func){spi->_RspQryFundTrans = func;}

// 查询客户通知
DLL_EXPORT_C_DECL void WINAPI tSetOnRspQryClientNotice(Trade* spi, void* func){spi->_RspQryClientNotice = func;}

// 期权标的信息查询
DLL_EXPORT_C_DECL void WINAPI tSetOnRspQryOptUnderly(Trade* spi, void* func){spi->_RspQryOptUnderly = func;}

// 证券行情查询
DLL_EXPORT_C_DECL void WINAPI tSetOnRspQrySecuDepthMarket(Trade* spi, void* func){spi->_RspQrySecuDepthMarket = func;}

// 历史报单查询
DLL_EXPORT_C_DECL void WINAPI tSetOnRspQryHistOrder(Trade* spi, void* func){spi->_RspQryHistOrder = func;}

// 历史成交查询
DLL_EXPORT_C_DECL void WINAPI tSetOnRspQryHistTrade(Trade* spi, void* func){spi->_RspQryHistTrade = func;}

//  主推-成交回报
DLL_EXPORT_C_DECL void WINAPI tSetOnRtnTrade(Trade* spi, void* func){spi->_RtnTrade = func;}

//  主推-报单回报
DLL_EXPORT_C_DECL void WINAPI tSetOnRtnOrder(Trade* spi, void* func){spi->_RtnOrder = func;}

//  主推-行权
DLL_EXPORT_C_DECL void WINAPI tSetOnRtnExercise(Trade* spi, void* func){spi->_RtnExercise = func;}

//  主推-申请组合
DLL_EXPORT_C_DECL void WINAPI tSetOnRtnCombAction(Trade* spi, void* func){spi->_RtnCombAction = func;}

//  主推-锁定
DLL_EXPORT_C_DECL void WINAPI tSetOnRtnLock(Trade* spi, void* func){spi->_RtnLock = func;}

//  主推-撤单错误回报
DLL_EXPORT_C_DECL void WINAPI tSetOnErrRtnOrderAction(Trade* spi, void* func){spi->_ErrRtnOrderAction = func;}

//  主推-客户通知
DLL_EXPORT_C_DECL void WINAPI tSetOnRtnClientNotice(Trade* spi, void* func){spi->_RtnClientNotice = func;}

DLL_EXPORT_C_DECL void* WINAPI tCreateApi(){return NewTradeApi("./log/");}
DLL_EXPORT_C_DECL void* WINAPI tCreateSpi(){return new Trade();}
DLL_EXPORT_C_DECL void* WINAPI tGetVersion() { return (void*)GetTradeApiVersion(); }


//  删除接口对象本身
DLL_EXPORT_C_DECL void* WINAPI tReleaseApi(CHSTradeApi *api){api->ReleaseApi(); return 0;}

//              pszSafeLevel          安全级别
DLL_EXPORT_C_DECL void* WINAPI tInit(CHSTradeApi *api, const char *pszLicFile, const char *pszSafeLevel, const char *pszPwd, const char *pszSslFile, const char *pszSslPwd){api->Init(pszLicFile, pszSafeLevel, pszPwd, pszSslFile, pszSslPwd); return 0;}

//  API和交易柜台建立连接，连接建立成功后，主线程会等待用户操作子线程退出
DLL_EXPORT_C_DECL void* WINAPI tJoin(CHSTradeApi *api){api->Join(); return 0;}

//  注册订阅模式（暂未支持）
DLL_EXPORT_C_DECL void* WINAPI tRegisterSubModel(CHSTradeApi *api, SUB_TERT_TYPE eSubType){api->RegisterSubModel(eSubType); return 0;}

//  注册前置机网络地址
DLL_EXPORT_C_DECL void* WINAPI tRegisterFront(CHSTradeApi *api, const char *pszFrontAddress){api->RegisterFront(pszFrontAddress); return 0;}

//  注册Fens网络地址
DLL_EXPORT_C_DECL void* WINAPI tRegisterFensServer(CHSTradeApi *api, const char *pszFensAddress, const char *pszAccountID){api->RegisterFensServer(pszFensAddress, pszAccountID); return 0;}

//  注册回调接口
DLL_EXPORT_C_DECL void* WINAPI tRegisterSpi(CHSTradeApi *api, CHSTradeSpi *pSpi){api->RegisterSpi(pSpi); return 0;}

//  获取当前交易日期
DLL_EXPORT_C_DECL void* WINAPI tGetTradingDate(CHSTradeApi *api){api->GetTradingDate(); return 0;}

//  接入认证 
DLL_EXPORT_C_DECL void* WINAPI tReqAuthenticate(CHSTradeApi *api, CHSReqAuthenticateField *pReqAuthenticate, int nRequestID){api->ReqAuthenticate(pReqAuthenticate, nRequestID); return 0;}

//  终端信息上报接口(中继模式)
DLL_EXPORT_C_DECL void* WINAPI tReqSubmitUserSystemInfo(CHSTradeApi *api, CHSReqUserSystemInfoField *pReqUserSystemInfo, int nRequestID){api->ReqSubmitUserSystemInfo(pReqUserSystemInfo, nRequestID); return 0;}

// 客户登录
DLL_EXPORT_C_DECL void* WINAPI tReqUserLogin(CHSTradeApi *api, CHSReqUserLoginField *pReqUserLogin, int nRequestID){api->ReqUserLogin(pReqUserLogin, nRequestID); return 0;}

// 密码更改
DLL_EXPORT_C_DECL void* WINAPI tReqUserPasswordUpdate(CHSTradeApi *api, CHSReqUserPasswordUpdateField *pReqUserPasswordUpdate, int nRequestID){api->ReqUserPasswordUpdate(pReqUserPasswordUpdate, nRequestID); return 0;}

// 报单录入
DLL_EXPORT_C_DECL void* WINAPI tReqOrderInsert(CHSTradeApi *api, CHSReqOrderInsertField *pReqOrderInsert, int nRequestID){api->ReqOrderInsert(pReqOrderInsert, nRequestID); return 0;}

// 撤单
DLL_EXPORT_C_DECL void* WINAPI tReqOrderAction(CHSTradeApi *api, CHSReqOrderActionField *pReqOrderAction, int nRequestID){api->ReqOrderAction(pReqOrderAction, nRequestID); return 0;}

// 行权录入
DLL_EXPORT_C_DECL void* WINAPI tReqExerciseOrderInsert(CHSTradeApi *api, CHSReqExerciseOrderInsertField *pReqExerciseOrderInsert, int nRequestID){api->ReqExerciseOrderInsert(pReqExerciseOrderInsert, nRequestID); return 0;}

// 行权撤单
DLL_EXPORT_C_DECL void* WINAPI tReqExerciseOrderAction(CHSTradeApi *api, CHSReqExerciseOrderActionField *pReqExerciseOrderAction, int nRequestID){api->ReqExerciseOrderAction(pReqExerciseOrderAction, nRequestID); return 0;}

// 锁定录入
DLL_EXPORT_C_DECL void* WINAPI tReqLockInsert(CHSTradeApi *api, CHSReqLockInsertField *pReqLockInsert, int nRequestID){api->ReqLockInsert(pReqLockInsert, nRequestID); return 0;}

// 询价录入
DLL_EXPORT_C_DECL void* WINAPI tReqForQuoteInsert(CHSTradeApi *api, CHSReqForQuoteInsertField *pReqForQuoteInsert, int nRequestID){api->ReqForQuoteInsert(pReqForQuoteInsert, nRequestID); return 0;}

// 申请组合录入
DLL_EXPORT_C_DECL void* WINAPI tReqCombActionInsert(CHSTradeApi *api, CHSReqCombActionInsertField *pReqCombActionInsert, int nRequestID){api->ReqCombActionInsert(pReqCombActionInsert, nRequestID); return 0;}

// 最大报单数量获取
DLL_EXPORT_C_DECL void* WINAPI tReqQueryMaxOrderVolume(CHSTradeApi *api, CHSReqQueryMaxOrderVolumeField *pReqQueryMaxOrderVolume, int nRequestID){api->ReqQueryMaxOrderVolume(pReqQueryMaxOrderVolume, nRequestID); return 0;}

// 可锁定数量获取
DLL_EXPORT_C_DECL void* WINAPI tReqQryLockVolume(CHSTradeApi *api, CHSReqQryLockVolumeField *pReqQryLockVolume, int nRequestID){api->ReqQryLockVolume(pReqQryLockVolume, nRequestID); return 0;}

// 可行权数量获取
DLL_EXPORT_C_DECL void* WINAPI tReqQueryExerciseVolume(CHSTradeApi *api, CHSReqQueryExerciseVolumeField *pReqQueryExerciseVolume, int nRequestID){api->ReqQueryExerciseVolume(pReqQueryExerciseVolume, nRequestID); return 0;}

// 申请组合最大数量获取
DLL_EXPORT_C_DECL void* WINAPI tReqQryCombVolume(CHSTradeApi *api, CHSReqQryCombVolumeField *pReqQryCombVolume, int nRequestID){api->ReqQryCombVolume(pReqQryCombVolume, nRequestID); return 0;}

// 持仓汇总查询
DLL_EXPORT_C_DECL void* WINAPI tReqQryPosition(CHSTradeApi *api, CHSReqQryPositionField *pReqQryPosition, int nRequestID){api->ReqQryPosition(pReqQryPosition, nRequestID); return 0;}

// 资金账户查询
DLL_EXPORT_C_DECL void* WINAPI tReqQryTradingAccount(CHSTradeApi *api, CHSReqQryTradingAccountField *pReqQryTradingAccount, int nRequestID){api->ReqQryTradingAccount(pReqQryTradingAccount, nRequestID); return 0;}

// 报单查询
DLL_EXPORT_C_DECL void* WINAPI tReqQryOrder(CHSTradeApi *api, CHSReqQryOrderField *pReqQryOrder, int nRequestID){api->ReqQryOrder(pReqQryOrder, nRequestID); return 0;}

// 成交查询
DLL_EXPORT_C_DECL void* WINAPI tReqQryTrade(CHSTradeApi *api, CHSReqQryTradeField *pReqQryTrade, int nRequestID){api->ReqQryTrade(pReqQryTrade, nRequestID); return 0;}

// 行权查询
DLL_EXPORT_C_DECL void* WINAPI tReqQryExercise(CHSTradeApi *api, CHSReqQryExerciseField *pReqQryExercise, int nRequestID){api->ReqQryExercise(pReqQryExercise, nRequestID); return 0;}

// 锁定查询
DLL_EXPORT_C_DECL void* WINAPI tReqQryLock(CHSTradeApi *api, CHSReqQryLockField *pReqQryLock, int nRequestID){api->ReqQryLock(pReqQryLock, nRequestID); return 0;}

// 申请组合查询
DLL_EXPORT_C_DECL void* WINAPI tReqQryCombAction(CHSTradeApi *api, CHSReqQryCombActionField *pReqQryCombAction, int nRequestID){api->ReqQryCombAction(pReqQryCombAction, nRequestID); return 0;}

// 组合持仓明细查询
DLL_EXPORT_C_DECL void* WINAPI tReqQryPositionCombineDetail(CHSTradeApi *api, CHSReqQryPositionCombineDetailField *pReqQryPositionCombineDetail, int nRequestID){api->ReqQryPositionCombineDetail(pReqQryPositionCombineDetail, nRequestID); return 0;}

// 合约信息查询
DLL_EXPORT_C_DECL void* WINAPI tReqQryInstrument(CHSTradeApi *api, CHSReqQryInstrumentField *pReqQryInstrument, int nRequestID){api->ReqQryInstrument(pReqQryInstrument, nRequestID); return 0;}

// 备兑缺口查询
DLL_EXPORT_C_DECL void* WINAPI tReqQryCoveredShort(CHSTradeApi *api, CHSReqQryCoveredShortField *pReqQryCoveredShort, int nRequestID){api->ReqQryCoveredShort(pReqQryCoveredShort, nRequestID); return 0;}

// 行权指派查询
DLL_EXPORT_C_DECL void* WINAPI tReqQryExerciseAssign(CHSTradeApi *api, CHSReqQryExerciseAssignField *pReqQryExerciseAssign, int nRequestID){api->ReqQryExerciseAssign(pReqQryExerciseAssign, nRequestID); return 0;}

// 银行转账
DLL_EXPORT_C_DECL void* WINAPI tReqTransfer(CHSTradeApi *api, CHSReqTransferField *pReqTransfer, int nRequestID){api->ReqTransfer(pReqTransfer, nRequestID); return 0;}

// 银行转账查询
DLL_EXPORT_C_DECL void* WINAPI tReqQryTransfer(CHSTradeApi *api, CHSReqQryTransferField *pReqQryTransfer, int nRequestID){api->ReqQryTransfer(pReqQryTransfer, nRequestID); return 0;}

// 银行余额查询
DLL_EXPORT_C_DECL void* WINAPI tReqQueryBankBalance(CHSTradeApi *api, CHSReqQueryBankBalanceField *pReqQueryBankBalance, int nRequestID){api->ReqQueryBankBalance(pReqQueryBankBalance, nRequestID); return 0;}

// 银行账户查询
DLL_EXPORT_C_DECL void* WINAPI tReqQueryBankAccount(CHSTradeApi *api, CHSReqQueryBankAccountField *pReqQueryBankAccount, int nRequestID){api->ReqQueryBankAccount(pReqQueryBankAccount, nRequestID); return 0;}

// 多中心资金调拨
DLL_EXPORT_C_DECL void* WINAPI tReqMultiCentreFundTrans(CHSTradeApi *api, CHSReqMultiCentreFundTransField *pReqMultiCentreFundTransfer, int nRequestID){api->ReqMultiCentreFundTrans(pReqMultiCentreFundTransfer, nRequestID); return 0;}

// 客户账单查询
DLL_EXPORT_C_DECL void* WINAPI tReqQueryBillContent(CHSTradeApi *api, CHSReqQueryBillContentField *pReqQueryBillContent, int nRequestID){api->ReqQueryBillContent(pReqQueryBillContent, nRequestID); return 0;}

// 客户账单确认
DLL_EXPORT_C_DECL void* WINAPI tReqBillConfirm(CHSTradeApi *api, CHSReqBillConfirmField *pReqBillConfirm, int nRequestID){api->ReqBillConfirm(pReqBillConfirm, nRequestID); return 0;}

// 保证金查询
DLL_EXPORT_C_DECL void* WINAPI tReqQryMargin(CHSTradeApi *api, CHSReqQryMarginField *pReqQryMargin, int nRequestID){api->ReqQryMargin(pReqQryMargin, nRequestID); return 0;}

// 手续费查询
DLL_EXPORT_C_DECL void* WINAPI tReqQryCommission(CHSTradeApi *api, CHSReqQryCommissionField *pReqQryCommission, int nRequestID){api->ReqQryCommission(pReqQryCommission, nRequestID); return 0;}

// 汇率查询
DLL_EXPORT_C_DECL void* WINAPI tReqQryExchangeRate(CHSTradeApi *api, CHSReqQryExchangeRateField *pReqQryExchangeRate, int nRequestID){api->ReqQryExchangeRate(pReqQryExchangeRate, nRequestID); return 0;}

// 持仓明细查询
DLL_EXPORT_C_DECL void* WINAPI tReqQryPositionDetail(CHSTradeApi *api, CHSReqQryPositionDetailField *pReqQryPositionDetail, int nRequestID){api->ReqQryPositionDetail(pReqQryPositionDetail, nRequestID); return 0;}

// 经纪公司配置参数查询
DLL_EXPORT_C_DECL void* WINAPI tReqQrySysConfig(CHSTradeApi *api, CHSReqQrySysConfigField *pReqQrySysConfig, int nRequestID){api->ReqQrySysConfig(pReqQrySysConfig, nRequestID); return 0;}

// 行情查询
DLL_EXPORT_C_DECL void* WINAPI tReqQryDepthMarketData(CHSTradeApi *api, CHSReqQryDepthMarketDataField *pReqQryDepthMarketData, int nRequestID){api->ReqQryDepthMarketData(pReqQryDepthMarketData, nRequestID); return 0;}

// 资金调拨
DLL_EXPORT_C_DECL void* WINAPI tReqFundTrans(CHSTradeApi *api, CHSReqFundTransField *pReqFundTransfer, int nRequestID){api->ReqFundTrans(pReqFundTransfer, nRequestID); return 0;}

// 资金调拨流水查询
DLL_EXPORT_C_DECL void* WINAPI tReqQryFundTrans(CHSTradeApi *api, CHSReqQryFundTransField *pReqQryFundTrans, int nRequestID){api->ReqQryFundTrans(pReqQryFundTrans, nRequestID); return 0;}

// 客户通知查询
DLL_EXPORT_C_DECL void* WINAPI tReqQryClientNotice(CHSTradeApi *api, CHSReqQryClientNoticeField *pReqQryClientNotice, int nRequestID){api->ReqQryClientNotice(pReqQryClientNotice, nRequestID); return 0;}

// 期权标的信息查询
DLL_EXPORT_C_DECL void* WINAPI tReqQryOptUnderly(CHSTradeApi *api, CHSReqQryOptUnderlyField *pReqQryOptUnderly, int nRequestID){api->ReqQryOptUnderly(pReqQryOptUnderly, nRequestID); return 0;}

// 证券行情查询
DLL_EXPORT_C_DECL void* WINAPI tReqQrySecuDepthMarket(CHSTradeApi *api, CHSReqQrySecuDepthMarketField *pReqQrySecuDepthMarket, int nRequestID){api->ReqQrySecuDepthMarket(pReqQrySecuDepthMarket, nRequestID); return 0;}

// 历史报单查询
DLL_EXPORT_C_DECL void* WINAPI tReqQryHistOrder(CHSTradeApi *api, CHSReqQryHistOrderField *pReqQryHistOrder, int nRequestID){api->ReqQryHistOrder(pReqQryHistOrder, nRequestID); return 0;}

// 历史成交查询
DLL_EXPORT_C_DECL void* WINAPI tReqQryHistTrade(CHSTradeApi *api, CHSReqQryHistTradeField *pReqQryHistTrade, int nRequestID){api->ReqQryHistTrade(pReqQryHistTrade, nRequestID); return 0;}

